﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace Dapper.Library
{
    public interface IQuery<T>
    {
        /// <summary>
        /// 获取
        /// </summary>
        /// <returns></returns>
        T Single();

        /// <summary>
        /// 异步获取
        /// </summary>
        /// <returns></returns>
        Task<T> SingleAsync();

        /// <summary>
        /// 转List
        /// </summary>
        /// <returns></returns>
        List<T> Multiple();

        /// <summary>
        /// 异步转List
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<T>> MultipleAsync();

        /// <summary>
        /// 获取分页信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        PageInfo<T> PageList(int pageIndex, int pageSize);

    }
}
